package blms.system.manager;

import java.util.Date;

import blms.system.user.User;


public class Tuple {

	private User user;
	private int initialHandicap;
	private int currentHandicap;
	private Date initialDate;
	
	public Tuple(User user, int initialHandicap,
			Date initialDate) {
		this.user = user;
		this.initialHandicap = initialHandicap;
		this.currentHandicap = initialHandicap;
		this.initialDate = initialDate;
	}

	public User getUser() {
		return user;
	}

	public int getInitialHandicap() {
		return initialHandicap;
	}

	public int getCurrentHandicap() {
		return currentHandicap;
	}

	public Date getInitialDate() {
		return initialDate;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + currentHandicap;
		result = prime * result
				+ ((initialDate == null) ? 0 : initialDate.hashCode());
		result = prime * result + initialHandicap;
		result = prime * result + ((user == null) ? 0 : user.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final Tuple other = (Tuple) obj;
		if (currentHandicap != other.currentHandicap)
			return false;
		if (initialDate == null) {
			if (other.initialDate != null)
				return false;
		} else if (!initialDate.equals(other.initialDate))
			return false;
		if (initialHandicap != other.initialHandicap)
			return false;
		if (user == null) {
			if (other.user != null)
				return false;
		} else if (!user.equals(other.user))
			return false;
		return true;
	}
	
	
}